#include <QCoreApplication>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int C=2;
    int Comm=0;
    for(int i=1;i<=2;i++)
    {
    cout<<"Nachalnoe napravlenie na yug, "<<"vvedite comandu "<<i<<", 0- 180grad, 1- left, -1 -right: ";
    cin>>Comm;
    if(Comm==1)
    C-=1;
    if(Comm==-1)
    C+=1;
    if(Comm==0)
    C+=2;
    if(C<0)
    C=3+C;
    if(C>3)
    C=C-4;
    }
    switch(C)
    {
    case 0: cout<<"Napravlenie na sever.";break;
    case 1: cout<<"Napravlenie na vostok.";break;
    case 2: cout<<"Napravlenie na yug.";break;
    case 3: cout<<"Napravlenie na zapad.";break;
    }

    return a.exec();
}
